package com.loto.insurance.oem.web.utils;

import java.util.Map;

import org.springframework.web.servlet.view.json.MappingJacksonJsonView;

public class MappingJacksonJsonViewEx extends MappingJacksonJsonView {
  @Override
  protected Object filterModel(Map<String, Object> model) {
	if (model.containsKey("oem_user"))
	  model.remove("oem_user");
	Object result = super.filterModel(model);
	if (!(result instanceof Map)) {
	  return result;
	}
	Map map = (Map) result;
	if (map.size() == 1) {
	  return map.values().toArray()[0];
	}
	return result;
  }
}